/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxinline.manager.criar;

import br.com.foxinline.modelo.CBO;
import br.com.foxinline.servico.CBOServico;
import br.com.foxinline.utilitario.Msg;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author ely
 */
@ManagedBean
@ViewScoped
public class ManagerCriarCBO {

    @EJB
    CBOServico cboServico;
    private CBO cbo;

    @PostConstruct
    public void init() {
        cbo = new CBO();
    }

    public void salvar() {
        try {
            cboServico.salvar(cbo);
            Msg.messagemInfo(Msg.SuccessFull);
            cbo = new CBO();
        } catch (Exception erro) {
        }
    }

    public CBO getCbo() {
        return cbo;
    }

    public void setCbo(CBO cbo) {
        this.cbo = cbo;
    }

}
